﻿using blackhouse.WebNemo.Business.Files;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace blackhouse.WebNemo.Web {
    public static class WebHeaderContentTypeExtension {

        public static void SetResponseHeaders(this HeaderContentType headerContent, HttpResponse response) {
            response.ContentType = headerContent.ContentType;
            response.AddHeader("Content-Length", headerContent.ContentLength.ToString());
            response.AddHeader("Content-Description", headerContent.ContentDescription);
            foreach (KeyValuePair<string, string> headerEntry in headerContent.ExtraHeaders) {
                response.AddHeader(headerEntry.Key, headerEntry.Value);
            }
        }

    }
}